// 封装获取员工简单列表的api

import request from '@/utils/request'

export function getEmployeesSimpleAPI () {
  return request({
    url: '/sys/user/simple'
  })
}

// 封装获取员工列表的API

export function getEmployeesListAPI(params) {
  return request({
    url: '/sys/user',
    params
  })
}

// 封装根据id删除员工的API
export function delEmployeeAPI(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

// 封装新增员工api
export function addEmployeeAPI(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

/**
 * @description: 导入excel批量添加员工
 * @param {*} data 包含员工信息的数组
 * @return {*}
 */
export function importEmployees(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 封装给员工分配角色的API  传入一个对象{id:id,roleIds:roleIds} id是角色id  roleIds是权限id
export function assignRolesAPI(data) {
  return request({
    url: '/sys/user/assignRoles',
    data,
    method: 'put'
  })
}
